using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

using ThoughtWorks.CruiseControl.Core.Util;



namespace CcNetTeamBuildTask
{
    public class Utilities
    {

        /// <summary>
        /// a helper class to execute an external program
        /// </summary>
        public static int ShellExecute(string command, string parameters, string workingPath)
        {
            System.Diagnostics.Process proc;

            System.Diagnostics.ProcessStartInfo startInfo =
                new System.Diagnostics.ProcessStartInfo(command, parameters);

            startInfo.UseShellExecute = false;
            startInfo.CreateNoWindow = true;
            startInfo.WorkingDirectory = workingPath;
            proc = System.Diagnostics.Process.Start(startInfo);

            proc.WaitForExit();

            return proc.ExitCode;
        }

    }
}
